/*
 * @Author: gitee_com_zb
 * @Date: 2024-12-17 15:21:34
 * @LastEditors: gitee_com_zb
 * @LastEditTime: 2024-12-17 15:21:45
 * @FilePath: /algorithm/每日一题14.消失的数字(easy).cpp
 * @Description: 题目链接 https://leetcode.cn/problems/missing-number-lcci
 */
class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int ret = 0;
        for(int i = 0; i <= nums.size(); i++) ret ^= i;
        for(auto &x : nums) ret ^= x;
        return ret;
    }
};